{% extends 'common/_base_center.html' %}
{% load static %}
{% block title %}重置密码{% endblock %}
{% block localcss %}
{% endblock %}
{% block content %}
    <div class="row w-100 mx-0 auth-page">
        <div class="col-md-8 col-xl-6 mx-auto">
            <div class="card">
                <div class="row">
                    <div class="col-md-4 pr-md-0">
                        <div class="auth-left-wrapper">

                        </div>
                    </div>
                    <div class="col-md-8 pl-md-0">
                        <div class="auth-form-wrapper px-4 py-5" style="min-height: 530px">
                            <span class="noble-ui-logo d-block mb-2">LDAP <span>platform</span></span>
                            <h5 class="text-muted font-weight-normal mb-4">
                                {% if error %}
                                    <span style="color:red">{{ error.message }}</span>
                                {% else %}
                                    Ldap Reset Password
                                {% endif %}
                            </h5>


                            <div class="container">
                                <!-- Tab panes -->
                                <div class="tab-content">
                                    <div id="standard" class="container tab-pane active"><br>
                                        <form class="forms-sample" method="post">
                                            <div class="row col-md-12">
                                                <input type="text" id="email_prefix" name="email_prefix"
                                                       class="form-control col-md-6" id=""
                                                       autocomplete="off"
                                                       placeholder="填入邮箱前缀"
                                                       required>
                                                <select class="form-control col-md-6" id="email_suffix"
                                                        name="email_suffix">
                                                    <option selected value="{{ DOMAIN_SUFFIX }}">@{{ DOMAIN_SUFFIX }}</option>
                                                </select>
                                            </div>

                                            <br/>


                                            <div class="mt-3">
                                                <button type="submit" onclick="on_submit()"
                                                        class="btn btn-primary btn-icon-text mr-2 mb-2 mb-md-0">
                                                    Ldap Reset
                                                </button>
                                            </div>
                                            Already have ldap login and password? <a href="/login/"
                                                                                     class="d-inline-block mt-3 text-muted">
                                            Sign in</a>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block localjs %}
    <script>
        function on_submit() {
            let email_prefix = $('#email_prefix').val();
            if (email_prefix !== '') {
                var index = layer.load(1, {
                    shade: [0.1, '#fff'] //0.1透明度的白色背景
                });
            }
        }

    </script>
{% endblock %}
